/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 言初
 * Date: 2023-03-08
 * Time: 9:07
 */
public class Test {
    public static void main(String[] args) {
        MyBinaryTree myBinaryTree=new MyBinaryTree();
        MyBinaryTree.TreeNode root=myBinaryTree.createTree();
        myBinaryTree.preOrder(root);
        System.out.println();
        myBinaryTree.inOrder(root);
        System.out.println();
        myBinaryTree.postOrder(root);
        System.out.println();
        myBinaryTree.size(root);
        System.out.println(MyBinaryTree.nodeSize);
        System.out.println(myBinaryTree.size2(root));
        myBinaryTree.getLeafNodeCount1(root);
        System.out.println(MyBinaryTree.leafSize);
        System.out.println(myBinaryTree.getLeafNodeCount2(root));
        System.out.println(myBinaryTree.getKLevelNodeCount(root,0));
        System.out.println(myBinaryTree.getKLevelNodeCount(root,1));
        System.out.println(myBinaryTree.getKLevelNodeCount(root,2));
        System.out.println(myBinaryTree.getKLevelNodeCount(root,3));
        System.out.println("树的高度"+myBinaryTree.getHeight(root));
        MyBinaryTree.TreeNode cur1=myBinaryTree.find(root,'c');
        if(cur1==null){
            System.out.println(false);
        }else{
            System.out.println(cur1.val);
        }
        MyBinaryTree.TreeNode cur2=myBinaryTree.find(root,'k');
        if(cur2==null){
            System.out.println(false);
        }else{
            System.out.println(cur2.val);
        }
        myBinaryTree.levelOrder(root);
        System.out.println();
        System.out.println(myBinaryTree.isCompleteTree(root));
    }
}
